package com.xlf.service.base.controller.client;

import com.xlf.common.core.annotation.Anonymous;
import com.xlf.common.core.pojo.mode.AjaxResult;
import com.xlf.common.core.pojo.mode.BaseController;
import com.xlf.service.base.service.AnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xlf 2734029211@qq.com
 * @Date 2023/12/31 11:18
 * @Description: TODO 公告模块
 * @Version 1.0
 */
@RestController
@RequestMapping("/base/announcement")
public class AnnouncementController extends BaseController {

    @Autowired
    AnnouncementService announcementService;


    /**
     * 获取公告列表
     * @return
     */
    @Anonymous
    @GetMapping("/list")
    public AjaxResult getCommonAnnouncement(){
        return success(announcementService.getCommonAnnouncement());
    }


    /**
     * 获取公告详情
     * @param id
     * @return
     */
    @Anonymous
    @GetMapping("/{id}")
    public AjaxResult query(@PathVariable(value = "id") Long id){
        return success(announcementService.getAnnouncement(id));
    }


}
